package com.pcitc.app.model;

import com.pcitc.app.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="TBL_POSITION_FUNC",schema="XZGD")
public class TblPositionFunc extends BaseObject implements Serializable {
    private Long pfkid;
    private TblPosition tblPosition;
    private Long funcid;

    @Id  @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getPfkid() {
        return this.pfkid;
    }
    
    public void setPfkid(Long pfkid) {
        this.pfkid = pfkid;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="POSITIONID")
    public TblPosition getTblPosition() {
        return this.tblPosition;
    }
    
    public void setTblPosition(TblPosition tblPosition) {
        this.tblPosition = tblPosition;
    }
    
    @Column(name="FUNCID", precision=22, scale=0)
    public Long getFuncid() {
        return this.funcid;
    }
    
    public void setFuncid(Long funcid) {
        this.funcid = funcid;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TblPositionFunc pojo = (TblPositionFunc) o;

        if (tblPosition != null ? !tblPosition.equals(pojo.tblPosition) : pojo.tblPosition != null) return false;
        if (funcid != null ? !funcid.equals(pojo.funcid) : pojo.funcid != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (tblPosition != null ? tblPosition.hashCode() : 0);
        result = 31 * result + (funcid != null ? funcid.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("pfkid").append("='").append(getPfkid()).append("', ");
        sb.append("tblPosition").append("='").append(getTblPosition()).append("', ");
        sb.append("funcid").append("='").append(getFuncid()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
